<?php
require '../script/mysqlconfig.php';
$conn = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
if ($conn->connect_error) {
    die("连接数据库失败: " . $conn->connect_error);
}

$id = $_GET["id"];
$sql = "DELETE FROM hosts WHERE id=$id";
if ($conn->query($sql) === true) {
    echo "设备删除成功。";
} else {
    echo "设备删除失败！错误原因如下" . "<br/>" . $conn->error;
}

mysqli_close($conn);
